<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>任务列表</title>
    <!-- 基本框架 -->
    <link rel="stylesheet" href="../../../css/common.css">
    <link rel="stylesheet" href="./css/sendDetail.css">
    <script src="../../../script/vue.min.js" type="text/javascript"></script>
    <script src="../../../script/frame.js" type="text/javascript"></script>
    <script src="../../../script/baseConfig.js" type="text/javascript"></script>
    <script src="../../../script/utils.js" type="text/javascript"></script>
    <script src="../../../script/common.js" type="text/javascript"></script>
</head>

<body>
    <div id="app" v-cloak>
        <template v-if="task !== null">
			<div class="container" :style="{'margin-bottom':batchReviewIds.length > 0 ? 'calc(' + api.safeArea.bottom + 'px + 1.35rem)' : '0'}">
				<div class="taskBasic">
                    <img v-if="showTaskDetail && task.diffculty_level != 0" :src="'../../../image/task/task_level_'+task.diffculty_level+'.png'" class="taskGender" />
					<div class="info clearfix">
						<img :src="task.platform.icon.url" />
						<div>
							<h3 class="ell">{{task.platform.name}} - {{task.project.name}}</h3>
							<span class="ell">{{task.time_created | dateFormate}}</span>
						</div>
					</div>
					<div class="progress"><i class="over" :style="{width: taskProgress}" ></i></div>
					<div class="clearfix twoLine">
						<div class="inlineInfo price ell">悬赏价格：<font>{{$.parsePrice(task.amount_actual, 2)}}<i>元</i></font></div>
						<div class="inlineInfo price ell">总赏金：<font>{{$.parsePrice(task.amount_total, 2)}}<i>元</i></font></div>
                    </div>
                    <div class="inlineInfo u-require">
                        <span class="_title canSelect">
                            任务要求：
                        </span>
						<span class="canSelect">{{task.title}}</span>
                    </div>
					<!-- <div class="inlineInfo">
                        任务要求：<font>{{task.title}}</font>
                    </div> -->
					<template v-if="showTaskDetail">
						<div class="clearfix twoLine">
							<div class="inlineInfo ell">已做数量：<font>{{task.total_accepts - task.total_surplus_accepts}}/{{task.total_accepts}}</font></div>
							<div class="inlineInfo ell">审核时间：<font>{{task.limited_time_approve}}分钟内</font></div>
							<!-- <div class="inlineInfo ell">有子任务：<font>{{taskDetails.pre_task_id==0?'无':'有'}}</fousernt></div> -->
						</div>
						<div class="clearfix twoLine">
							<div class="inlineInfo ell">编号 ID：<font>{{task.id}}</font></div>
							<div class="inlineInfo ell">任务限制：<font>{{limitOS}}</font></div>
						</div>
						<div class="inlineInfo person ell flex">本任务限制：<font>{{task.project.timing_max_accepts==0?'不限制':task.project.timing_max_accepts+'次/天'}}</font></div>
						<div class="inlineInfo times disbox">距离任务关闭还有：<font>{{taskEndTimeStr}}</font></div>
					</template>
					<div class="showMore" @click="toggleShowTaskDetail">
						<img src="../../../image/task/bottom.png" class="dire_bottom" :class="{show: showTaskDetail}" />
					</div>
				</div>
				<div class="typeDiv">
					<div class="typeSelect clearfix">
						<a @click="tabIndex = 0" :class="{hover: tabIndex == 0}">审核任务</a>
						<a @click="tabIndex = 1" :class="{hover: tabIndex == 1}">任务步骤</a>
					</div>
					<!-- 审核任务 -->
					<template v-if="tabIndex == 0">
						<div class="status">
							<a @click="changeSubTab(index)" :class="{hover: subTabIndex == index}" v-for="(tab,index) in subTabs">{{tab.text}}</a>
                        </div>
                        <template v-if="accepters != null">
                            <template v-if="accepters.length > 0">
                            <ul class="examine">
                                <template v-for="(item, index) in accepters">
                                    <!-- 进行中 -->
                                    <li v-if="item.status.value == 1">
                                        <div class="basic_info clearfix">
                                            <img :src="item.user.avatar" class="head" />
                                            <div class="info">
                                                <div class="bas-title disbox">
                                                    <h3 class="ell disflex">{{item.user.nick_name}}</h3>
                                                    <span style="color: #b8b8b8">{{item.status.text}}</span>
                                                </div>
                                                <div class="time disbox">
                                                    <span class="ell disflex">接单时间：{{item.time_created | dateFormate}}</span>
                                                </div>
                                            </div>
                                        </div>
                                    </li>
                                    <!-- 待审核 -->
                                    <li v-if="item.status.value == 2">
                                        <div class="basic_info clearfix">
                                            <img :src="item.user.avatar" class="head" />
                                            <div class="info">
                                                <div class="bas-title disbox">
                                                    <h3 class="ell disflex">{{item.user.nick_name}}</h3>
                                                    <span style="color: #b8b8b8">{{item.status.text}}</span>
                                                </div>
                                                <div class="time disbox">
                                                    <span class="ell disflex">接单时间：{{item.time_created | dateFormate}}</span>
                                                    <img @click="reviewCheck(item.id)" v-if="batchReviewIds.indexOf(item.id) == -1" src="../../../image/icons/checkbox2.png" />
                                                    <img @click="reviewCheck(item.id)" v-else src="../../../image/icons/checkbox2_hover.png" />
                                                </div>
                                            </div>
                                        </div>
                                        <div class="lookImg clearfix" v-if="getStepsImgs(item.custom_steps).length > 0">
                                            <div class="item" v-for="img in getStepsImgs(item.custom_steps)" >
                                                <img :src="img.uri" />
                                                <span @click="viewPicture(img.uri)">放大</span>
                                            </div>
                                        </div>
                                        <div class="name" v-for="txt in getStepsCollectTxts(item.custom_steps)">{{txt.placeholder}}：<font color="#9A9A9A">{{txt.value}}</font></div>
                                        <div class="btnAll" v-if="batchReviewIds.length > 0">   
                                            <a style="opacity: .3">审核通过</a>
                                            <a  bad style="opacity: .3">不通过</a>
                                        </div>
                                        <div class="btnAll" v-else>   
                                            <a @click="singleApprove(item.id, true)">审核通过</a>
                                            <a @click="singleApprove(item.id, false)" bad>不通过</a>
                                        </div>
                                    </li>
                                    <!-- 已完成 -->
                                    <li v-if="item.status.value == 3">
                                        <div class="basic_info clearfix">
                                            <img :src="item.user.avatar" class="head" />
                                            <div class="info">
                                                <div class="bas-title disbox">
                                                    <h3 class="ell disflex">{{item.user.nick_name}}</h3>
                                                    <span style="color: #67d765">{{item.status.text}}</span>
                                                </div>
                                                <div class="time disbox">
                                                    <span class="ell disflex">接单时间：{{item.time_created | dateFormate}}</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="lookImg clearfix" v-if="getStepsImgs(item.custom_steps).length > 0">
                                            <div class="item" v-for="img in getStepsImgs(item.custom_steps)" >
                                                <img :src="img.uri" />
                                                <span @click="viewPicture(img.uri)">放大</span>
                                            </div>
                                        </div>
                                        <div class="name" v-for="txt in getStepsCollectTxts(item.custom_steps)">{{txt.placeholder}}：<font color="#9A9A9A">{{txt.value}}</font></div>
                                    </li>
                                    <!-- 仲裁中 -->
                                    <li v-if="item.status.value == 4">
                                        <div class="basic_info clearfix">
                                            <img :src="item.user.avatar" class="head" />
                                            <div class="info">
                                                <div class="bas-title disbox">
                                                    <h3 class="ell disflex">{{item.user.nick_name}}</h3>
                                                    <span style="color:#719dff">{{item.status.text}}</span>
                                                </div>
                                                <div class="time disbox">
                                                    <span class="ell disflex">接单时间：{{item.time_created | dateFormate}}</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="lookImg clearfix" v-if="getStepsImgs(item.custom_steps).length > 0">
                                            <div class="item" v-for="img in getStepsImgs(item.custom_steps)" >
                                                <img :src="img.uri" />
                                                <span @click="viewPicture(img.uri)">放大</span>
                                            </div>
                                        </div>
                                        <div class="name" v-for="txt in getStepsCollectTxts(item.custom_steps)">{{txt.placeholder}}：<font color="#9A9A9A">{{txt.value}}</font></div>
                                        <font v-if="item.arbitration_id" @click="goArbitrationDetail(item.arbitration_id)" class="lookArb"></font>
                                    </li>
                                    <!-- 未通过 -->
                                    <li v-if="item.status.value == 5">
                                        <div class="basic_info clearfix">
                                            <img :src="item.user.avatar" class="head" />
                                            <div class="info">
                                                <div class="bas-title disbox">
                                                    <h3 class="ell disflex">{{item.user.nick_name}}</h3>
                                                    <span style="color: #ff4e4e">{{item.status.text}}</span>
                                                </div>
                                                <div class="time disbox">
                                                    <span class="ell disflex">接单时间：{{item.time_created | dateFormate}}</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="lookImg clearfix" v-if="getStepsImgs(item.custom_steps).length > 0">
                                            <div class="item" v-for="img in getStepsImgs(item.custom_steps)" >
                                                <img :src="img.uri" />
                                                <span @click="viewPicture(img.uri)">放大</span>
                                            </div>
                                        </div>
                                        <div class="name" v-for="txt in getStepsCollectTxts(item.custom_steps)">{{txt.placeholder}}：<font color="#9A9A9A">{{txt.value}}</font></div>
                                    </li>
                                    <!-- 已关闭 -->
                                    <li v-if="item.status.value == 6">
                                        <div class="basic_info clearfix">
                                            <img :src="item.user.avatar" class="head" />
                                            <div class="info">
                                                <div class="bas-title disbox">
                                                    <h3 class="ell disflex">{{item.user.nick_name}}</h3>
                                                    <span style="color: #b8b8b8">{{item.status.text}}</span>
                                                </div>
                                                <div class="time disbox">
                                                    <span class="ell disflex">接单时间：{{item.time_created | dateFormate}}</span>
                                                </div>
                                            </div>
                                        </div>
                                    </li>
                                </template>
                            </ul>
                            <div class="loadText">
                                <div class="weui-loadmore" v-if="hasMore">
                                    <i class="weui-loading"></i>
                                    <span class="weui-loadmore__tips">正在加载</span>
                                </div>
                                <span v-else class="over">我已经到底啦！</span>
                            </div>
                            </template>
                            <template v-else>
                                <section class="m-no">
                                    <div class="u-img"></div>
                                    <div class="u-spec">暂无数据</div>
                                </section>
                            </template>
                        </template>
                        <template v-else>
                            <div class="minHeightFull">
                                <div class="loadLayer"><span></span> <span></span> <span></span> <span></span> <span></span></div>
                            </div>
                        </template>
					</template>
					<!-- 任务步骤 -->
					<template v-if="tabIndex == 1">
						<div class="m-step">
							<div class="step stepDom">
								<div class="step_content clearfix" v-for="(step, stepIndex) in task.custom_steps">
									<i>{{stepIndex+1}}</i>
									<div class="info">
										<h3 class="h3">第{{Nzh.encodeS(stepIndex+1)}}步</h3>
										<template v-if="step.length > 0" v-for="(item, index) in step">
											<!-- 文本描述 -->
											<template v-if="item.type == 'Description'">
												<div class="intrText">{{item.value}}</div>
											</template>
											<!-- 可操作内容 -->
											<template v-if="item.type == 'Operable'">
												<div class="btnText" >
													<div class="text"> 
														<!-- <div> -->
															{{item.target.type}}：
														<!-- </div> -->
														<span class="_link copyDom">{{item.target.value}}</span>
													</div>
													<div class="btn clearfix">
														<a @click="onCommandAction(cmd, item.target.value)" v-for="(cmd, index) in commandsConfig[item.target.type]">{{cmd.name}}</a>
													</div>
												</div>
											</template>
											<!-- 收集用户文字信息 -->
											<template  v-if="item.type == 'CollectTextInfo'">
												<div class="task_input flex">
													<input type="text" class="flex1" disabled="true" :placeholder="'请输入' + item.placeholder" />
												</div>
											</template>
											<!-- 图片 -->
											<template v-if="utils.isArray(item)" >
												<div class="img clearfix">
													<div class="item" v-for="imgItem in item">
														<template v-if="imgItem.type == 'Gallery'">
															<img class="comImgwh" :src="imgItem.uri" />
															<span @click="viewPicture(imgItem.uri)" v-if="true">示例图</span>
														</template>
														<template v-if="imgItem.type == 'CollectGallery'">
															<img class="comImgwh" src="../../../image/task/addImg2.png"/>
														</template>
													</div>
												</div>                 
											</template>
										</template>
									</div>
								</div>
							</div>
						</div>
					</template>
				</div>
				<div v-if="batchReviewIds.length > 0" id="footer" :style="{'padding-bottom':api.safeArea.bottom + 'px'}">
					<div class="m-btn" @click="batchApprove">
						<div class="_wrap">批量审核</div>
					</div>
				</div>
			</div>
        </template>
        <template v-else>
            <div class="loadFull whiteBg">
                <div class="se-loading"></div>
            </div>
        </template>
    </div>
    <script src="./js/sendDetail.js"></script>
</body>

</html>
